<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var num1 = getRandom(1, 10);
        console.log(num1);
        while (true) {
            for (var i = 1; i <= 5; i++) {
                var num = prompt('请猜猜看我这个数字是多少？');
                if (num > num1) {
                    alert('数字大了，请继续猜吧');
                } else if (num < num1) {
                    alert('数字小了，请继续猜吧');
                } else {
                    alert('66666');
                    break;
                }
            }
            alert('你可真笨啊，猜10次都没猜对')
            break;
        }

        function getRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }
    </script>
</head>

<body>

</body>

</html>